package admin

import (
	"html/template"
	"strconv"
	"xianzhi/service"
)

type OrderSchoolController struct {
	BaseController
}

func (c *OrderSchoolController) ShowAllList() {
	p := map[string]interface{}{}
	orderId := c.Ctx.Input.Param(":id")
	c.Data["orderId"] = orderId
	if len(orderId) > 0 {
		p["orderId"] = orderId
	}
	isExcellent := c.GetString("is_excellent")
	if len(isExcellent) > 0 {
		p["isExcellent"] = isExcellent
		c.Data["isExcellent"], _ = strconv.Atoi(isExcellent)
	} else {
		c.Data["isExcellent"] = -1
	}
	isAssist := c.GetString("is_assist")
	if len(isAssist) > 0 {
		p["isAssist"] = isAssist
		c.Data["isAssist"], _ = strconv.Atoi(isAssist)
	} else {
		c.Data["isAssist"] = -1
	}
	p["convert"] = true
	_, recordList := service.GetOrderSchoolList(p)
	c.Data["recordList"] = recordList
	c.Data["xsrfdata"] = template.HTML(c.XSRFFormHTML())
	c.TplName = "admin/order_school/all_list.html"
}